# 导包
import pymysql
# 创建链接
connect = pymysql.connect(host='localhost', port=3306, user='root', password='root', database='books',autocommit=True)
# 创建游标
cursor = connect.cursor()
# 执行sql
sql = 'delete from t_book where title="东游记";'
cursor.execute(sql)
print(cursor.rowcount)
# 关闭游标
cursor.close()
# 关闭链接
connect.close()